package com.ruoyi.user.service.impl;

import com.ruoyi.common.utils.DateUtils;

import com.ruoyi.user.domain.Families1;
import com.ruoyi.user.mapper.Families1Mapper;
import com.ruoyi.user.service.IFamilies1Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 家庭信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-30
 */
@Service
public class Families1ServiceImpl implements IFamilies1Service
{
    @Autowired
    private Families1Mapper families1Mapper;

    /**
     * 查询家庭信息
     * 
     * @param id 家庭信息主键
     * @return 家庭信息
     */
    @Override
    public Families1 selectFamiliesById(Long id)
    {
        return families1Mapper.selectFamiliesById(id);
    }

    /**
     * 查询家庭信息列表
     * 
     * @param families1 家庭信息
     * @return 家庭信息
     */
    @Override
    public List<Families1> selectFamiliesList(Families1 families1)
    {
        return families1Mapper.selectFamiliesList(families1);
    }

    /**
     * 新增家庭信息
     * 
     * @param families1 家庭信息
     * @return 结果
     */
    @Override
    public int insertFamilies(Families1 families1)
    {
        families1.setCreateTime(DateUtils.getNowDate());
        return families1Mapper.insertFamilies(families1);
    }

    /**
     * 修改家庭信息
     * 
     * @param families1 家庭信息
     * @return 结果
     */
    @Override
    public int updateFamilies(Families1 families1)
    {
        families1.setUpdateTime(DateUtils.getNowDate());
        return families1Mapper.updateFamilies(families1);
    }

    /**
     * 批量删除家庭信息
     * 
     * @param ids 需要删除的家庭信息主键
     * @return 结果
     */
    @Override
    public int deleteFamiliesByIds(Long[] ids)
    {
        return families1Mapper.deleteFamiliesByIds(ids);
    }

    /**
     * 删除家庭信息信息
     * 
     * @param id 家庭信息主键
     * @return 结果
     */
    @Override
    public int deleteFamiliesById(Long id)
    {
        return families1Mapper.deleteFamiliesById(id);
    }
}
